Code-Smells Detection as a Bi-Level Problem
نویسندگان
چکیده
Code-Smells represent design situations that can affect the maintenance and evolution of software. They make a system difficult to evolve. Code-smells are detected, in general, using quality metrics that represent some symptoms. However, the selection of suitable quality metrics is challenging due to the absence of consensus to identify some code-smells based on a set of symptoms and also the high calibration effort to determine manually the thresholds value for each metric. In this paper, we propose, for the first time, to consider the generation of code-smells detection rules as a bi-level optimization problem. Bi-level optimization problems are a new class of challenging optimization problems, which contain two levels of optimization tasks. In these problems, only the optimal solutions to the lower level problem become possible feasible candidates to the upper level problem. In this sense, the code-smell detection problem is truly a bi-level optimization problem, but due to lack of suitable solution techniques, it was attempted to solve using a single-level optimization problem in the past. In our adaptation here, the upper level problem generates a set of detection rules, combination of quality metrics, which maximizes the coverage of a base of code-smell examples and artificial code-smells generated by the lower level. The lower level maximizes the number of generated artificial code-smells that cannot be detected by the rules produced by the upper level. The main advantage of our bi-level formulation is that the generation of detection rules is not limited to some code-smell examples identified manually by developers which are difficult to collect but it allows the prediction of new code-smells behavior that are different from those in the base of examples. The statistical analysis of our experiments over 31 runs on 9 open source systems shows that 7 types of code-smell were detected with an average of more than 85% in terms of precision and recall. The results confirm the outperformance of our bi-level proposal compared to state-of-art code-smells detection techniques.
منابع مشابه
An Empirical Study of Bad Smell in Code on Maintenance Effort
In this paper, we represent an automated code smell detection and refactoring tool for calculating risk factor by detecting Code Smells and decrease risk factor by Refactoring Techniques. Refactoring is a process for restructuring or improving internal structure of software without changing its behavior. A new code smell (Lazy Catch) detection is also presented. To achieve this aim Declarative ...
متن کاملCode-Smells Detection using Good and Bad Software Design Examples
Code-Smells refer to design situations that may adversely affect the maintenance of software. They make a system difficult to change, which may in turn introduce bugs. Codesmells are detected, in general, using quality metrics that formalize some symptoms based on detection rules. We propose in this work to consider the problem of code-smells detection as a multi-objective problem where example...
متن کاملInvestigating the Role of Code Smells in Preventive Maintenance
The quest for improving the software quality has given rise to various studies which focus on the enhancement of the quality of software through various processes. Code smells, which are indicators of the software quality have not been put to an extensive study for as to determine their role in the prediction of defects in the software. This study aims to investigate the role of code smells in ...
متن کاملAn Eclipse Plugin to Support Code Smells Detection
Eradication of code smells is often pointed out as a way to improve readability, extensibility and design in existing software. However, code smell detection in large systems remains time consuming and error-prone, partly due to the inherent subjectivity of the detection processes presently available. In view of mitigating the subjectivity problem, this paper presents a tool that automates a te...
متن کاملDo they Really Smell Bad? A Study on Developers’ Perception of Code Bad Smells
In the last decade several catalogues have been defined to characterize code bad smells, i.e., symptoms of poor design and implementation choices. On top of such catalogues, researchers have defined methods and tools to automatically detect and/or remove bad smells. Nevertheless, there is an ongoing debate regarding the extent to which developers perceive bad smells as serious design problems. ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013